<extend name="Index/index"/>

<block name="content">
    <!--<div class="view-product" style="margin-top: 50px">-->
    <div class="info-center">
        <div class="layui-container">
            <div class="layui-row"style="margin-top: 50px">

                <div class="layui-col-md5 layui-col-md-offset1"style="margin-top: 50px" id="edit">
                    <form class="layui-form" action="{{:U('Fee/edit')}}" method="post">
                        <input type="hidden" name="id" value="{{$feeInfo.id}}">
                        <div class="layui-form-item">
                            <label class="layui-form-label">缴纳时间</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input"  lay-verify="required" value="{{:substr($feeInfo['create_time'],0,7)}}" readonly id="start">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">缴纳金额</label>
                            <div class="layui-input-inline">
                                <input type="number" name="price" autocomplete="off" class="layui-input"
                                       lay-verify="required" value="{{$feeInfo['price']}}" min="0">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">缴纳至</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="time" id="test1" lay-verify="required" value="{{:substr($feeInfo['effect_time'],0,7)}}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit>立即提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
        <script>
            // Demo
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(formDemo)', function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return false;
                });
            });
            layui.use('laydate', function () {
                var laydate = layui.laydate;
                //日期时间选择器
                laydate.render({
                    elem: '#test1'
                    , type: 'month'
                });
            });
            $("#edit").submit(function () {
                var start_time = Date.parse(new Date($("#start").val()));
                var end_time = Date.parse(new Date($("#test1").val()));
                if(start_time > end_time){
                    layui.use("layer",function(){
                        layer = layui.layer;
                        layer.msg("缴纳至日期必须大于缴纳日期");
                    });
                    return false;
                }
                return true;
            })
        </script>

    </div>
    <!--</div>-->

</block>